package com.wrx.server.controller;

import com.wrx.server.pojo.RespBean;
import com.wrx.server.pojo.UserRegisterParam;
import com.wrx.server.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 注册
 */
@RestController
@Api(tags = "RegisterController")
public class RegisterController {

    @Autowired
    private IUserService userService;

    @ApiOperation(value = "用户注册")
    @PostMapping("/register")
    public RespBean register(@RequestBody UserRegisterParam userRegisterParam,HttpServletRequest request){
        System.out.println(userRegisterParam.getCheckpassword()+" "+userRegisterParam.getPassword());
        return userService.register(userRegisterParam,request);
    }


}
